package com.developtools.view;

import com.developtools.model.ApiUploadModel;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;

/**
 * @author jun
 */
public class ApiUploadDialogWrapper extends DialogWrapper {

    private final Project project;
    private final ApiUploadModel apiUploadModel;

    public ApiUploadDialogWrapper(Project project, ApiUploadModel apiUploadModel) {
        super(true);
        this.project = project;
        this.apiUploadModel = apiUploadModel;

        setOKButtonText("保存并上传");
        setCancelButtonText("取消");
        init();
    }

    @Override
    protected @Nullable JComponent createCenterPanel() {
        return new ApiUploadView(apiUploadModel).getUploadPanel();
    }
}
